package net.bluemind.ysnp;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class YSNPConfiguration {

	public static final String CFG = "/etc/ysnp/ysnp.conf";
	private Properties conf;

	public YSNPConfiguration() throws FileNotFoundException, IOException {
		conf = new Properties();
		FileInputStream in = new FileInputStream(CFG);
		conf.load(in);
		in.close();
	}

	public String getSocketPath() {
		return getString("daemon.socket.path");
	}

	public int getExecutorsCount() {
		return Integer.parseInt(getString("daemon.threads"));
	}

	public String getString(String confKey) {
		return conf.getProperty(confKey);
	}

}
